import static org.junit.Assert.*;

import org.junit.Test;


public class TestCreditCard {

	/*
	 * 
	private static int fLastCreditCardNumber;
	private int fAccountConnectedTo;
	private int fCreditCardNumber;
	private String fName;
	private String fStreet;
	private String fTown;
	private String fzipCode;
	private String fCountry;
	private double fLimit; // you cannot spend more than this limit
	private double fBalance;
	
	public CreditCard(String name, String street, String town, String zipCode, String country)

	
	public CreditCard(String name, String street, String town, String zipCode, String country, double limit)

	
	public boolean pay(double amount)

	 */
	@Test
	public void test() {

		Person p1 = new Person("testAccount1", "street1", "zip1", "town1", "country1");
		Person p2 = new Person("testAccount2", "street2", "zip2", "town2", "country2");
		Person p3 = new Person("testAccount3", "street3", "zip3", "town3", "country3");
		CreditCard testCard1 = new CreditCard(p1, 10000);
		CreditCard testCard2 = new CreditCard(p2, 1000.0);
		CreditCard testCard3 = new CreditCard(p3, 2000.0);

		assertTrue(testCard1.pay(100.0));
		assertFalse(testCard1.pay(10000.0));
		assertTrue(testCard1.pay(125.0));
		assertEquals(testCard1.getBalance(), -225.0, 0.00000001);
		
		assertTrue(testCard2.pay(100.0));
		assertFalse(testCard2.pay(10000.0));
		assertEquals(testCard2.getBalance(), -100.0, 0.00000001);
		assertTrue(testCard2.pay(125.0));
		assertEquals(testCard2.getBalance(), -225.0, 0.00000001);
	}

}
